package com.xbongbong.saas.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 报价单产品
 *
 * @author long.rao
 * @version v1.0
 * @date 2019/8/16 10:05
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class QuotationProductEntity extends BusinessUnitProductEntity implements Serializable {

    private static final long serialVersionUID = 4984030198521551656L;

    private Long id;
    // 公司ID
    private String corpid;
    // 报价单ID
    private Long quotationId;
    // 产品ID
    private Long parentId;
    // 产品ID
    private Long productId;
    // 产品数量
    private Double productNum;
    // 产品名称
    private String productName;
    //产品编号
    private String productNo;
    // 报价
    private Double price;
    //单位
    private String productUnit;
    // 折扣
    private Double discount;
    // 产品规格
    private String specification;
    //产品图片
    private String productThumbnail;
    //产品备注
    private String memo;
    // 产品成本
    private Double cost;
    //条码
    private String barcode;
    // 排序
    private Integer sort;
    // 添加时间
    private Long addTime;
    // 更新时间
    private Long updateTime;
    // 删除标记
    private Integer del;
    //自定义字段
    private JSONObject data;
    /**
     * 待采购合同扩展字段：当前产品总库存
     */
    private Double total;

    // 产品历史单价
    private Double historicalPrice;
    /**
     * 单价
     */
    private Double unitPrice;

    private JSONArray productPriceArr;

    public QuotationProductEntity() {
        long now = DateTimeUtil.getInt();
        this.corpid = "";
        this.quotationId = 0L;
        this.productId = 0L;
        this.productNum = 0d;
        this.productName = "";
        this.price = 0D;
        this.specification = "";
        this.discount = 100d;
        this.memo = "";
        this.sort = 0;

        this.addTime = now;
        this.updateTime = now;
        this.del = 0;
        this.cost = 0D;
    }
}
